package com.atxiaodei.kabudashejimoshi.委派模式;

import java.util.HashMap;
import java.util.Map;

/**
 * @ClassName Leader
 * @Deacription 创建项目经理委派者
 * @Author 卡布达
 * @Date 2021/10/13 21:35
 * @Version 1.0
 **/
public class Leader implements IEmployee{

    private Map<String,IEmployee> target=new HashMap<>();

    public Leader(){
        target.put("需求A",new EmployeeA());
        target.put("需求B",new EmployeeA());
    }

    // 项目经理不干活，把需求传递给开发做
    @Override
    public void doing(String command) {
        target.get(command).doing(command);
    }
}
